package com.icrazy.platform.util;

import org.apache.log4j.PropertyConfigurator;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

/**
 * Spring配置文件读取
 * 
 * @author xiaofeng
 * @version 2012-2-6
 */
public class SpringBeanUtils {
	public static Object getBean(String id) {
		PropertyConfigurator.configure("./WebRoot/WEB-INF/classes/config/log4j.properties");
		ApplicationContext ctx = new FileSystemXmlApplicationContext("classpath*:config/applicationContext*.xml");
		return ctx.getBean(id);
	}
}
